package cn.ad.server.domain.enumration;

import java.util.HashMap;
import java.util.Map;

public enum Income {
	NULLINCOME("无收入",1),//	无收入
	INCOME1000ANDLESS("1000元以下",2),//	1000元以下
	INCOME1000TO1499("1000-1499",4),//1000-1499
	INCOME1500TO1999("1500-1999",8),//1500-1999	
	INCOME2000TO2999("2000-2999",16),//2000-2999
	INCOME3000TO3999("3000-3999",32),//3000-3999
	INCOME4000TO4999("4000-4999",64),//4000-4999
	INCOME5000TO5999("5000-5999",128),//5000-5999
	INCOME6000TO7999("6000-7999",256),//5000-5999
	INCOME8000TO9999("8000-9999",512),//8000-9999
	INCOME10000TO14999("10000-14999",1024),//10000-14999	
	INCOME15000TO19999("15000-19999",2048),//15000-19999
	INCOME20000ANDTHAN("20000元以上",4096);//20000元以上
	
    private String name;
    private int value;
    
    
    private static java.util.HashMap<String,Integer> mappings;

    public static HashMap<String,Income> incomeMap;

    static {
    	incomeMap = new HashMap<>();
        for (Income e : values()) {
        	incomeMap.put(e.getName(), e);
        }
    }
    private synchronized static java.util.HashMap<String, Integer> getMappings() {
        if (mappings == null) {
            mappings = new java.util.LinkedHashMap<String, Integer>();
            for (Income format : Income.values()) {
                mappings.put(format.name, format.value);
            }
        }
        return mappings;
    }

    private Income(String name, int value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

	public int getValue() {
		return value;
	}
	 public static Map<String,Integer> getMapping(){
	        return getMappings();
	 }
}
